import requests


def ocr_val(img):

    with open(img, 'rb') as image_file:
        image_bytes = image_file.read()

    resp = requests.post("http://127.0.0.1:9898/ocr/file", files={'image': image_bytes})
    text = resp.content.decode('utf-8')

    # 打印字符串
    print(text)

    return text